package com.example.test.advice.第二章_基本类型.建议21_用偶判断不用奇判断;

import java.util.Scanner;

public class Client {

    public static void main(String[] args) {
        //接收键盘收入参数
        Scanner input = new Scanner(System.in);
        System.out.println("请输入多个数字判断奇偶：");
        while (input.hasNextInt()){
            int i = input.nextInt();
            //String str = i+"->"+(i%2==1?"奇数":"偶数");//负数情况就出问题了，比如-1，-3余数不等于1但是也不属于偶数
            //更改后
            String str = i+"->"+(i%2==0?"偶数":"奇数");
            System.out.println(str);
        }
    }
}
